const express = require('express')
const cors = require('cors')
const routes = require('./routes')

const app = express()
const port = process.env.PORT || 3000

// 中间件
app.use(cors())
app.use(express.json())

// 路由
app.use('/api', routes)

app.listen(port, () => {
  console.log(`Server running on port ${port}`)
})